#include "BoardConf.h"
#include "Montion.h"
#include "Button.h"
#include "LightCircuit.h"
#include "BoardAssembly.h"
#include "AmbientLight.h"
#include "SimpleLight.h"

ServiceFactory::ServiceFactory(IArduino& a, MessageRouter& router, ILogger& logger) 
: _router(router), _arduino(a), logger_(logger){
}

Service& ServiceFactory::createMontion(const String& name, int pin){
	return *new Montion(_arduino, _router, name, logger_, pin);
}

Service& ServiceFactory::createButton(const String& name, int pin){
	return *new Button(_arduino, _router, name, logger_, pin);
}
Service& ServiceFactory::createLight(const String& name, int pin){
	return *new LightCircuit(_arduino, _router, name, logger_, pin);
}

Service& ServiceFactory::createAmbient(const String& name, const String& buttonTrigger, const String& montionTrigger, const String& lightCircuit){
	AmbientLight* a = new AmbientLight(_arduino, _router, name, logger_, buttonTrigger, lightCircuit, montionTrigger);
	return *a;
}
Service& ServiceFactory::createSimpleLight(const String& name, const String& buttonTrigger, const String& lightCircuit){
	SimpleLight* a = new SimpleLight(_arduino, _router, name, logger_, buttonTrigger, lightCircuit);
	return *a;
}